home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / rss / older.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  894 b   |  46 lines

  1. /*                              O L D E R . C
  2.  
  3.     % 1 name
  4. \funcref {older}
  5.     % 2 declaration
  6. {int \fname (\params\ )}
  7.     % 3 arguments
  8. {
  9.     {char *}{lval}{name of a file}
  10.     {char *}{rval}{name of a file}
  11. }
  12.     % 4 return value
  13. {
  14.  1: the file \Var{lval} is older than \Var{rval} or \Var{rval} does't exist.
  15.     \Var{lval} exists.
  16.  0: the reversed condition: the file \Var{lval} is younger or as old as
  17.     \Var{rval} (\Var{rval} exists), or \Var{lval} doesn't exist
  18. }
  19.     % 5 functions used
  20. {}
  21.     % 6 see also
  22. {}
  23.     % 7 source file
  24. {older.c}
  25.     % 8 description
  26. {See the return value description}
  27. */
  28.  
  29. #include "icrssdef.h"
  30.  
  31. int older(lval, rval)
  32.     char
  33.         *lval,
  34.         *rval;
  35. {
  36.     struct stat
  37.         lbuf,
  38.         rbuf;
  39.  
  40.     if (stat(lval, &lbuf))
  41.         lbuf.st_mtime = 0;
  42.     if (stat(rval, &rbuf))
  43.         rbuf.st_mtime = 0;
  44.  
  45.    return (lbuf.st_mtime < rbuf.st_mtime);
  46. }